<template>
	<view class="box">
		<u-toast ref="uToast"></u-toast>
		<view class="box-content">
			<textarea v-model="value" height="800"placeholder="请输入驳回意见……" disabledColor='#f6f6f6'
				style="background:#f6f6f6;margin-bottom: 30px;width: 100%!important;border-radius: 16rpx;padding: 24px;box-sizing: border-box;"></textarea>
		</view>
		<view class="btn">
			<u-button type="primary" @click="submit" text="确定"></u-button>
		</view>
	</view>
</template>

<script>
	import { edit } from '../../api/yhzl.js'
	export default {
		data() {
			return {
				value:'',
				obj:{},
				state:1,
				show: false,
			}
		},
		onLoad(obj) {
			this.obj = JSON.parse(obj.details)
			// console.log(789,this.obj)
		},
		methods: {
			submit(){
				// console.log(this.obj.id);
				if(this.value == ''){
					uni.showToast({
						icon:'none',
						title:'驳回意见不能为空'
					})
					return
				}
				const form ={
					id:this.obj.id,
					state:this.state,
					yj:this.value
				}
				// console.log(form);
				edit(form).then((res) =>{
					// console.log();
					// this.value = '',
					if(res.code == 200){
						this.$refs.uToast.show({
							type: 'success',
							message: "驳回成功",
							iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/jump.png'
						})
						window.setTimeout(function () {
						    uni.reLaunch({
						    	url:'/pages/home/home'
						    })
						}, 1000);	
					}
				})
			}
		}
	}
</script>

<style>
.box{
	width: 100vw;
	height: calc(100vh - 88rpx);
	padding: 40rpx 24rpx;
	box-sizing: border-box;
	.box-content{
		width: 702rpx;
		height: 1200rpx;
		
	}
	
}
textarea{
	height: 1000rpx!important;
}
</style>
